package cn.edu.sgu.www.mhxysy.dto.achievement;

import cn.edu.sgu.www.mhxysy.consts.CustomMessages;
import cn.edu.sgu.www.mhxysy.consts.RegExps;
import cn.edu.sgu.www.mhxysy.dto.DataTransferObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Positive;
import java.time.LocalDate;

/**
 * @author 沐雨橙风ιε
 * @version 1.0
 */
@Data
@ApiModel
public class RoleChengweiDTO implements DataTransferObject {

    @ApiModelProperty(value = "ID")
    private String id;

    /**
     * 装饰过期时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "装饰过期时间")
    private LocalDate endTime;

    /**
     * 使用状态
     */
    @Range(min = 0, max = 1, message = "使用状态" + CustomMessages.ILLEGAL)
    @NotNull(message = "使用状态" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "使用状态", required = true)
    private Integer useStatus;

    /**
     * 角色ID
     */
    @Pattern(regexp = RegExps.ROLE_ID, message = "角色ID" + CustomMessages.ILLEGAL)
    @NotBlank(message = CustomMessages.ROLE_ID_NOT_NULL)
    @ApiModelProperty(value = "角色ID", required = true)
    private String roleId;

    /**
     * 称谓ID
     */
    @Positive(message = "称谓ID" + CustomMessages.ILLEGAL)
    @NotNull(message = "称谓" + CustomMessages.ID_NOT_NULL)
    @ApiModelProperty(value = "称谓ID", required = true)
    private Integer chengweiId;
}